In an electronic control unit, which is mounted in a vehicle, for example, it is required to hold in a non-volatile memory control data, which is generated at time of detection of a certain abnormality or generated before the detection of such an abnormality. The control data, which is thus kept stored, is referred to as freeze frame data or freeze data and used to analyze a cause of generation of the abnormality, as exemplarily disclosed in JP 2007-138726A.
To meet the requirement described above, the following processing is proposed as one example. For each control data of plural kinds, which will possibly be required as the freeze frame data, memory areas for holding “m” (integer equal to or larger than 1) pieces of the control data are provided in the non-volatile memory. In this case, addresses for writing each data are pre-assigned. Last “M” pieces of each control data including the latest piece are written to be held continuously in the corresponding addresses in the data holding areas. According to this configuration, all kinds of control data are stored in the data holding areas upon detection of any abnormality.
Since the control data having only low relation to the detected abnormality, that is, control data which need not be stored usually, are also stored, the memory areas to be provided as the data holding areas need be increased.